# coding: utf-8
import csv
csvfile = file('c:\\temp\\final.csv','wb')
writer = csv.writer(csvfile)

newcsvfile = file('c:\\temp\\aaa.csv', 'rb')
oldcsvfile = file('c:\\temp\\bbb.csv', 'rb')
newreader = csv.reader(newcsvfile)
oldreader = csv.reader(oldcsvfile)
newindex = 0
oldindex = 0
fnd = False
signstr = ''

for newrow in newreader:
    for oldrow in oldreader:
        if oldrow == newrow:
            fnd = True
            break      
        
        elif(oldrow[0] == newrow[0] and oldrow[27]==newrow[27]):
            if oldrow[5]!=newrow[5]:
                signstr = signstr + 'A'
            if oldrow[16]!=newrow[16]:
                signstr = signstr + 'B'
            if oldrow[17]!=newrow[17]:
                signstr = signstr + 'C'
            if oldrow[19]!=newrow[19]:
                signstr = signstr + 'D'
            print newrow[0] + '==' + signstr
            signstr = ''
            fnd = True
            break
#
#        else:
#            fnd = False
#            continue

    if fnd == False:
        print newrow[0] + '   ||||   ' + 'No found!'
        continue
#        fnd == True
    
            
oldcsvfile.close()
newcsvfile.close()
csvfile.close()
